Five ways to get the program's current working directory and execution directory in C #String Str= "";str + = "\ r \ n" + System.Diagnostics.Process.GetCurrentProcess (). Mainmodule.filename;str + = "\ r \ n" +
Program | execution
1. System.Diagnostics.Process.GetCurrentProcess (). Mainmodule.filenameGets the full path of the module.2. System.Environment.CurrentDirectoryGets and sets the fully qualified directory of the current directory (the directory
Program | execution
1. System.Diagnostics.Process.GetCurrentProcess (). Mainmodule.filename
Gets the full path of the module.
2. System.Environment.CurrentDirectory
Gets and sets the fully qualified directory of the current directory (the
After a trial, QT initiates a new process, the working directory of the process is inherited from the parent process, either through start or startdetached.In fact, for the Linux system, the QT bottom should also call fork, exec and other functions,
Beginner Erlang, when compiling the. erl file, Tip:
>1 C (some_module)
./some_module.erl:none:no such file or directory
Error
This is because the. erl file is not being caused in the current working directory of Erlang. Enter the following
C #, ASP. NET gets the absolute path of the current application, gets the program working path ============================================ using Application.startuppathAs forSystem.IO.Directory.GetCurrentDirectory, because the application has a
WinForm Gets a collection of methods for the current path of the application, as follows, which is worth collecting//gets the full path of the current process, including the file name (process name). stringstr = This. GetType ().
C # Seven methods for obtaining the current path,
Summary C # Seven methods for obtaining the current path
C # The method for obtaining the current path is as follows:
1. System. Diagnostics. Process. GetCurrentProcess (). MainModule. FileName
C # Get the current path methodGets the path or UNC location of the loaded file that contains the manifest.public static string Sapplicationpath = Assembly.getexecutingassembly (). Location;Result:x:\xxx\xxx\xxx.dll (the directory where the. dll
Https://www.cnblogs.com/tianma3798/p/6553863.html1.Gets the path or UNC location of the loaded file that contains the manifest. public static string Sapplicationpath = Assembly.getexecutingassembly (). Location;//result:x:\xxx\xxx\xxx.dll (the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.